﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.IO;

using HKEA.CMS.Core.BLL;
using HKEA.CMS.Core.Models;
using iMaker.Library;

using HKEA.CMS.Core.Utility;

using HKEA.CMS.Core.DALFactory;
using HKEA.CMS.Core.BLL.Tbl;

namespace WebApplication.test
{
    public partial class BuilderCode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //tbCodeGeneratorBLL bll = new tbCodeGeneratorBLL();//tbCodeGeneratorBLL.GetInstance();
            //string code = bll.BuilderCustomerCode("fck");
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            PageParam pager = new PageParam();
            pager.PageSize = 10; pager.CurrentPage = 1;

            tblCustomerBLL bll = tblCustomerBLL.GetInstance();
            tblCustomer ent = new tblCustomer();

            if (DropDownList1.SelectedValue == "yes")
            {
                GridView1.DataSource = bll.GetListByENT(ent, ref pager, "Name_Eng", "desc");
                GridView1.DataBind();
            }
            else if (DropDownList1.SelectedValue == "no")
            {
                GridView1.DataSource = bll.GetListByENT(ent, ref pager, "Name_Eng", "asc");
                GridView1.DataBind();
            } 
        }

        public void GetSqlLog()
        {
            
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string path = Server.MapPath("~/media/upload/jacktest.jpg");
            HttpPostedFile file = Request.Files["FileUpload1"];
            FileOperate.ResizeImage(file,path,600,400);
        }


    }
}